import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("applet", { schema: "frog_charge" })
export class Applet {
  @PrimaryGeneratedColumn({ type: "tinyint", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "name", length: 10 })
  name: string;

  @Column("tinyint", {
    name: "type",
    comment: "1wechat,2alipay",
    default: () => "'0'",
  })
  type: number;

  @Column("varchar", { name: "appid", length: 32 })
  appid: string;

  @Column("varchar", { name: "app_secret", length: 32 })
  appSecret: string;

  @Column("varchar", { name: "mchid", length: 32 })
  mchid: string;

  @Column("varchar", { name: "notify_url", length: 50 })
  notifyUrl: string;

  @Column("varchar", { name: "serial_no", length: 40 })
  serialNo: string;

  @Column("varchar", { name: "v3api_secret", comment: "V3 API ", length: 32 })
  v3apiSecret: string;

  @Column("varchar", { name: "private_key", length: 2000 })
  privateKey: string;

  @Column("int", { name: "update_time", unsigned: true, default: () => "'0'" })
  updateTime: number;

  @Column("int", { name: "create_time", unsigned: true, default: () => "'0'" })
  createTime: number;
}
